package QueueDemo;


public class ArrayQueue<E> implements Queue<E> {
	
	Array<E> array;
	
	public ArrayQueue(int capacity) {
		array = new Array<>(capacity);
	}

	public ArrayQueue() {
		array = new Array<>();
	}
	
	@Override
	public void dequeue(E e) {
		array.addLast(e);
		
	}

	@Override
	public E dequeue() {
		return array.deleteFirst();
	}

	@Override
	public E getFront() {
		return array.getFirst();
	}

	@Override
	public int getSize() {
		return array.getSize();
	}

	@Override
	public boolean isEmpty() {
		return array.isEmpty();
	}

	public static void main(String[] args) {
		ArrayQueue<Integer> a = new ArrayQueue<>();
		for(int i=0;i<10;i++) {
			a.dequeue(i);
		}
		System.out.println(a);
	}

	@Override
	public String toString() {
		return "ArrayQueue [array=" + array + "]";
	}
}
